package com.lenovo.vod.player.callback;

import com.lenovo.vod.player.Constant;
import com.lenovo.vod.player.Engine;

import android.util.Log;
import android.view.SurfaceHolder;

public class SurfaceHolderCallback implements SurfaceHolder.Callback {
	private Engine mEngine;

	public SurfaceHolderCallback(Engine engine) {
		mEngine = engine;
	}

	@Override
	public void surfaceChanged(SurfaceHolder surfaceholder, int i, int j, int k) {
		Log.d(Constant.TAG, "surfaceChanged called");
	}

	@Override
	public void surfaceDestroyed(SurfaceHolder surfaceholder) {
		Log.d(Constant.TAG, "surfaceDestroyed called");

		mEngine.destroy();
	}

	@Override
	public void surfaceCreated(SurfaceHolder holder) 
	{
		Log.d(Constant.TAG, "surfaceCreated called");
		
		/* [s] guo-wj update */
		
		// 多码流
//		mEngine.play("http://tvlenovo.com/upload/all.m3u8");
		
		// 1200000 超清码流
//		mEngine.play("http://meta.video.qiyi.com/289/d581cb01b70baae6f981237e30507fca.m3u8");
		
		// 350000 高清码流
//		mEngine.play("http://meta.video.qiyi.com/288/8157240a96e2c45bc40b8d6ae658135d.m3u8");
		
	    // 1:  http://123.125.117.76/videos/0146df4735c3cb283712a29daa480f0b.m3u8
		// 2:  http://123.125.117.76/videos/1d891d3122647d835e9b7f1fcfe4ce83.m3u8
		// 3:  http://123.125.117.76/videos/4285b7774df201cca7ccf107d4419d44.m3u8
		// 4:  http://123.125.117.76/videos/527c10f706398247ab4f36b56f41f4d1.m3u8
		// 5:  http://123.125.117.76/videos/8cd1d0e41edac19178e136fc71b0aaa7.m3u8
		// 6:  http://123.125.117.76/videos/a2909d4e8f41edbfe1b3276816ff418d.m3u8
		// 7:  http://123.125.117.76/videos/e738041f4e10dddf50d9863f49cd7bdd.m3u8
		// 8:  http://123.125.117.76/videos/f05c8a45ef0abd6b73815682e03e31f5.m3u8
		// 9:  http://123.125.117.76/videos/f0870452ca23af76515d18857b1892ee.m3u8
		// 10: http://123.125.117.76/videos/fe51c99fc81e4bb91bce554af9c9c19f.m3u8
		
		 
		mEngine.play("http://123.125.117.76/videos/fe51c99fc81e4bb91bce554af9c9c19f.m3u8");
	
//		mEngine.play(null);
	}

}
